<SCRIPT language=JavaScript>
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
</SCRIPT>
<?
include("db.php");
if(isset($_POST['login'])){
	$login=$_POST['login'];
	$senha=$_POST['senha'];
	$result=mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='".$login."' AND memb__pwd='".$senha."'");
	if(mssql_num_rows($result)==0){
		echo "<script>alert('Login ou senha não encontrado(s)')</script>";
	echo "<script>window.location='index.php?x=home'</script>";
	}
	else {

	$result2=mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='".$login."' AND vip='1'");
	if(mssql_num_rows($result2)==0){

		echo "<script>alert('Você Não é VIP')</script>";
	echo "<script>window.location='index.php?x=home'</script>";

		}
	else {
		session_start();
		$_SESSION['login']=$login;
		$_SESSION['senha']=$senha;
		echo "<script>alert('Logado com sucesso!')</script>";
		echo "<script>window.location='index.php?x=logado'</script>";

		}


	}
}
?>
